package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.SysDictType;
import com.ruoyi.system.domain.dto.SysDictTypeDTO;
import com.ruoyi.system.mapper.SysDictTypeMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 字典 业务层处理
 */
@Service
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService {
    @Resource
    private SysDictTypeMapper sysDictTypeMapper;

    @Override
    public List<SysDictType> getDictTypeList(SysDictTypeDTO params) {
        if(StringUtils.isNotBlank(params.getStartDate())){
            params.setStartDate(params.getStartDate() + " 00:00:00");
        }
        if(StringUtils.isNotBlank(params.getEndDate())){
            params.setStartDate(params.getEndDate() + " 23:59:59");
        }
        return sysDictTypeMapper.getDictTypeList(params);
    }
}
